


<template>
  <div class="model-form">
    <el-page-header @back="goBack" content="增加订单">
    </el-page-header>
    <div class="model-content">
      <el-form ref="ruleForm" :rules="rules" :model="form" label-width="160px">
        <el-row :gutter="10">
 <el-col :span="12">
     <el-form-item label="订单号" size="mini" prop="no">
             <el-input v-model="form.no" name="no">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="合并支付订单号" size="mini" prop="mergeOrderCode">
             <el-input v-model="form.mergeOrderCode" name="mergeOrderCode">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="外部交易流水号" size="mini" prop="outTradeNum">
             <el-input v-model="form.outTradeNum" name="outTradeNum">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="订单来源" size="mini" prop="orderSource">
             <el-input v-model="form.orderSource" name="orderSource">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="支付来源" size="mini" prop="paySource">
             <el-input v-model="form.paySource" name="paySource">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="最新售后ID" size="mini" prop="newRefundId">
             <el-input v-model="form.newRefundId" name="newRefundId">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="订单状态" size="mini" prop="state">
             <el-input v-model="form.state" name="state">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="评价状态" size="mini" prop="commentState">
             <el-input v-model="form.commentState" name="commentState">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="用户删除" size="mini" prop="userState">
             <el-input v-model="form.userState" name="userState">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="下单时间" size="mini" prop="orderTime">
             <el-input v-model="form.orderTime" name="orderTime">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="支付时间" size="mini" prop="payTime">
             <el-input v-model="form.payTime" name="payTime">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="发货时间" size="mini" prop="deliveryTime">
             <el-input v-model="form.deliveryTime" name="deliveryTime">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="收货时间" size="mini" prop="receiveTime">
             <el-input v-model="form.receiveTime" name="receiveTime">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="订单类型" size="mini" prop="orderType">
             <el-input v-model="form.orderType" name="orderType">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="重量" size="mini" prop="weight">
             <el-input v-model="form.weight" name="weight">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="原价" size="mini" prop="totalAmount">
             <el-input v-model="form.totalAmount" name="totalAmount">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="应付金额" size="mini" prop="amount">
             <el-input v-model="form.amount" name="amount">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="整单折扣" size="mini" prop="changeAmount">
             <el-input v-model="form.changeAmount" name="changeAmount">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="实际支付金额" size="mini" prop="payAmount">
             <el-input v-model="form.payAmount" name="payAmount">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="运费" size="mini" prop="freight">
             <el-input v-model="form.freight" name="freight">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="卖家优惠券总金额" size="mini" prop="discount">
             <el-input v-model="form.discount" name="discount">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="平台优惠券总金额" size="mini" prop="platformDiscount">
             <el-input v-model="form.platformDiscount" name="platformDiscount">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="积分抵扣" size="mini" prop="integralDiscount">
             <el-input v-model="form.integralDiscount" name="integralDiscount">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="使用积分数" size="mini" prop="useIntegral">
             <el-input v-model="form.useIntegral" name="useIntegral">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="使用红包" size="mini" prop="useRedPacket">
             <el-input v-model="form.useRedPacket" name="useRedPacket">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="单件商品红包抵扣" size="mini" prop="redPacketDiscount">
             <el-input v-model="form.redPacketDiscount" name="redPacketDiscount">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="退款金额" size="mini" prop="returnAmount">
             <el-input v-model="form.returnAmount" name="returnAmount">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="积分赠送" size="mini" prop="sendIntegral">
             <el-input v-model="form.sendIntegral" name="sendIntegral">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="系统自动收货时间" size="mini" prop="sysReceiveTime">
             <el-input v-model="form.sysReceiveTime" name="sysReceiveTime">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="是否已延长收货" size="mini" prop="hasExtendReceive">
             <el-input v-model="form.hasExtendReceive" name="hasExtendReceive">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="商家改价格时间" size="mini" prop="editPriceTime">
             <el-input v-model="form.editPriceTime" name="editPriceTime">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="完成时间" size="mini" prop="finishTime">
             <el-input v-model="form.finishTime" name="finishTime">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="购买数量" size="mini" prop="productCount">
             <el-input v-model="form.productCount" name="productCount">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="退货数量" size="mini" prop="returnCount">
             <el-input v-model="form.returnCount" name="returnCount">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="最后提现时间" size="mini" prop="remindTime">
             <el-input v-model="form.remindTime" name="remindTime">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="联系电话" size="mini" prop="phone">
             <el-input v-model="form.phone" name="phone">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="收货地址" size="mini" prop="address">
             <el-input v-model="form.address" name="address">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="备注" size="mini" prop="note">
             <el-input v-model="form.note" name="note">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="收货人" size="mini" prop="consignee">
             <el-input v-model="form.consignee" name="consignee">
             </el-input>
     </el-form-item>
      
 </el-col>
        </el-row>
        <el-row>
          <el-col :span="24" style="text-align: right;padding-bottom: 20px;padding-top: 20px;">
            <el-button @click="goBack">取消</el-button>
            <el-button type="primary" @click="add">确定</el-button>
          </el-col>
        </el-row>
      </el-form>
    </div>
  </div>
</template>

<script>
  import common from "@/mixins/common.js";
  var config = {};
  config.methods = {};
  config.mixins = [common];


	config.data = function () {
			return {
				form: {
					no: '',
					mergeOrderCode: '',
					outTradeNum: '',
					orderSource: '',
					paySource: '',
					newRefundId: '',
					state: '',
					commentState: '',
					userState: '',
					orderTime: '',
					payTime: '',
					deliveryTime: '',
					receiveTime: '',
					orderType: '',
					weight: '',
					totalAmount: '',
					amount: '',
					changeAmount: '',
					payAmount: '',
					freight: '',
					discount: '',
					platformDiscount: '',
					integralDiscount: '',
					useIntegral: '',
					useRedPacket: '',
					redPacketDiscount: '',
					returnAmount: '',
					sendIntegral: '',
					sysReceiveTime: '',
					hasExtendReceive: '',
					editPriceTime: '',
					finishTime: '',
					productCount: '',
					returnCount: '',
					remindTime: '',
					phone: '',
					address: '',
					note: '',
					consignee: ''				},
				rules: {
				}
			}
	};




  config.methods.add = function () {
			var self = this;
			this.$refs["ruleForm"].validate(function(valid){
				if (valid) {
					self.addData();
				} else {
					console.log('error submit!!');
					return false;
				}
			});
		}

	config.methods.addData = function () {
			var self = this, data = this.form;
			if (this.deforeAddData) {
				this.deforeAddData();
			}
			this.postData("/tenantRest/orderform/create.htm", data, function (res) {
				if (res.code == 0) {
					self.$message({
						message: '添加数据成功',
						type: 'success'
					});
					self.$router.go(-1);
				} else {
					self.$message.error(res.msg);
				}
			});
		}


  
  	config.mounted = function () {
		}


  export default config;
</script>

<style scoped>
</style>